import { createPortal } from "react-dom";
import st from "./pop.module.css";
const PopAlert = ({ children, visable, onClose,onConfirm }: any) => {
  const PopView = visable ? (
    <div className={st.cover} onClick={onClose}>
      <div className={st.dialog}>
        <div className={st.text}>{children}</div>
        <div className={st.btn} onClick={()=>{onClose();onConfirm()}}>朕晓得了</div>
      </div>
    </div>
  ) : null;
  return createPortal(PopView, document.body);
};
export default PopAlert;
